# D:\数据集\无人机数据集\红外和RGB视频数据集\Drone-detection-dataset-master\Drone-detection-dataset-master\Data\Video_V

import os

# 获取数据集视频的类别数，并根据类名创建相应的文件夹
video_path = r"D:\数据集\无人机数据集\红外和RGB视频数据集\Drone-detection-dataset-master\Drone-detection-dataset-master\Data\Video_V"
cls_name = set()  # {'AIRPLANE', 'BIRD', 'DRONE', 'HELICOPTER'}
target_dir = r"E:\uav_datasets\Drone_detection_dataset"
# 获取分类名，组成集合
for file_name in os.listdir(video_path):
    origin_name, ext = os.path.splitext(file_name)
    if ext == ".mp4":  # 筛选mp4文件
        cls = origin_name.split("_")[1]
        cls_name.add(origin_name.split("_")[1])  # 将其分类添加进集合
print(cls_name)

# 创建每个分类的目录
for cls_nm in cls_name:
    os.mkdir(target_dir + cls_nm)
